//
//  ViewController.m
//  链式语法
//
//  Created by 申元江 on 2018/8/16.
//  Copyright © 2018年 申元江. All rights reserved.
//

#import "ViewController.h"
#import <Masonry.h>
@interface ViewController ()

@property (nonatomic,strong) NSString *name;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    NSLog(@"%@",self.select.where(@"love you"));
    //    self.select.where.select(@"sdcd");
    //链式语法延伸  getter
    //学习 函数 ---> block （保存代码块）
    self.name;
    
    //延伸 ---> make.left.mas_equals(100);  --->  Masonry
    //函数指针 --->函数实现
    // oc --> c  --> objc_sendMessage(id self, SEL ,_cmd ,id)
    
    UIButton *button;
    [self.view addSubview:button];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
}

-(NSString *)name
{
    return @"笑话";
}

-(ViewController *)select
{
    NSLog(@"上山打老虎");
    return self;
}

-(NSString *(^)(NSString *word))where
{
    NSLog(@"sdsdsd");
    NSString * (^block)(NSString *word) = ^(NSString *str){
        str = [NSString stringWithFormat:@"%@内是内",str];
        return str;
    };
    return block;
}


































@end
